import request from '@/utils/request'

export function blogTable(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/blog/manage/table`,
    method: 'post',
    data: query
  })
}

export function blogFileTable(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/blog/manage/fileTable`,
    method: 'post',
    data: query
  })
}

export function blogLoad(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/blog/manage/load`,
    method: 'get',
    params: query
  })
}

export function blogNextIndex(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/blog/manage/nextIndex`,
    method: 'get',
    params: query
  })
}

export function blogContent(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/blog/manage/loadContent`,
    method: 'get',
    params: query
  })
}

export function blogFeatured(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/blog/manage/featured`,
    method: 'post',
    data: query
  })
}

export function blogTop(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/blog/manage/top`,
    method: 'post',
    data: query
  })
}

export function blogPublish(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/blog/manage/publish`,
    method: 'post',
    data: query
  })
}

export function blogSave(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/blog/manage/save`,
    method: 'post',
    data: query
  })
}

export function blogDelete(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/blog/manage/delete`,
    method: 'post',
    data: query
  })
}

export function blogClearIndex() {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/blog/manage/clearIndex`,
    method: 'post'
  })
}

export function saveGroupBlog(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/blog/manage/saveGroupFormWithFile`,
    method: 'post',
    data: query
  })
}
